# Maintainer: Anatol Pomozov

pkgname=aws-c-sdkutils
pkgver=0.1.12
pkgrel=1
pkgdesc='AWS SDK utility library'
arch=(loong64 x86_64)
url='https://github.com/awslabs/aws-c-sdkutils'
license=(Apache)
depends=(aws-c-common)
makedepends=(cmake)
source=(aws-c-sdkutils-$pkgver.zip::https://github.com/awslabs/aws-c-sdkutils/archive/v$pkgver.zip)
sha256sums=('148c8e58499e25af2bf669d5daea29a1f962d5a6e861dfe8c9c9014327cb2ddc')

build() {
  cd aws-c-sdkutils-$pkgver

  cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -S . -B build
  cmake --build build
}

check() {
  cd aws-c-sdkutils-$pkgver
  cmake --build build --target test
}

package() {
  cd aws-c-sdkutils-$pkgver

  cmake --build build --target install -- DESTDIR="$pkgdir/"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
